
Khan S Alam 1 https://E-next.in
University Practicals Question Bank:
8.i
Use digit extraction method(1
st
,3
rd
,and 5
th
)for hashing the following values
224562,140145,14467,137456,214576,199645,214562,162145,234534 in an array
of 19 elements. Use linear probe method to resolve any collisions.
8.ii
Use Fold shift method for hashing the following values 224562, 140145, 14467,
137456, 214576, 199645, 214562, 162145, 234534 in an array of 19 elements.
Use linear probe method to resolve any collisions.
8.iii
Use Fold boundary method for hashing the following values
224562,140145,14467,137456,214576,199645,214562,162145,234534 in an array
of 19 elements. Use linear probe method to resolve any collisions.
8.iv
Use direct hashing method to insert the keys 99, 33, 23, 44, 56, 43, 19 in an array
of 10 elements. Use linear probe method to resolve any collisions.
Note: In this question the array size is mentioned as 10. But according to
the direct hashing (hashkey is the element itself). So, these given numbers
cannot be accommodated in the array size of 10, so the array size is
changed to 100 and is solved using the same.
8.v
Use subtraction hashing method to insert the keys 99, 33, 23, 44, 56, 43, 19 in an
array of 10 elements. Use linear probe method to resolve any collisions.
Note: in this question the array size is mentioned as 10. But according to
the subtraction technique (list size-key) cannot be accommodated in the
array size of 10, so it is to be solved using modulo division instead of
subtraction.
8.vi
Use modulo division hashing method to insert the keys 55, 65, 20, 12, 66, 26, 90 in
an array of 13 elements. Use linear probe method to resolve any collisions.
Solution
Refer to the C++ source code below.